package com.ymatou.paygetway.testcase;

import java.io.IOException;
import java.math.BigDecimal;
import java.security.PrivateKey;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.apache.http.client.ClientProtocolException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.payment.parameter.AcquireOrderBean;
import com.ymatou.iapi.payment.parameter.AliPayNotifyBean;
import com.ymatou.iapi.payment.parameter.AliPayWapNotifyBean;
import com.ymatou.iapi.payment.parameter.HipoNotifyBean;
import com.ymatou.iapi.payment.parameter.PayOrderEnum;
import com.ymatou.iapi.payment.parameter.PayTypeEnum;
import com.ymatou.iapi.payment.parameter.WeiXinNotifyBean;
import com.ymatou.iapi.payment.service.AcquireOrderCall;
import com.ymatou.mq.admin.parameter.MessageListBean;
import com.ymatou.paygetway.parameter.ApplePayNotifyBean;
import com.ymatou.paygetway.parameter.BaoFuNotifyBean;
import com.ymatou.paygetway.parameter.BestPayNotifyBean;
import com.ymatou.paygetway.parameter.CMBNotifyBean;
import com.ymatou.paygetway.parameter.HipoNotifyH5Bean;
import com.ymatou.paygetway.parameter.SFTNotifyBean;
import com.ymatou.paygetway.service.HipoPayNotifyCall;
import com.ymatou.paygetway.service.HipoPayNotifyH5Call;
import com.ymatou.paygetway.service.NotifyCall;
import com.ymatou.paygetway.service.NotifyCall50;
import com.ymatou.paygetway.service.NotifyCall70;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.core.tool.RSAUtils;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.business.data.Sign;
import com.ymttest.business.data.applepaysign.ApplePayConstants;
import com.ymttest.business.data.applepaysign.Hex;
import com.ymttest.business.data.applepaysign.SecurityUtil;
import com.ymttest.business.service.MqQueryCallService;
import com.ymttest.business.service.PayGateWayCallService;
import com.ymttest.common.enums.BankIdEnum;
import com.ymttest.database.model.Account;
import com.ymttest.database.model.AccountEntry;
import com.ymttest.database.model.MPayment;
import com.ymttest.database.model.ThirdpartyUserbind;
import com.ymttest.database.sqlwapper.AccountWapper;
import com.ymttest.database.sqlwapper.JUserWapper;
import com.ymttest.database.sqlwapper.PayGateWayWapper;
import com.ymttest.database.sqlwapper.PaymentDefaultWapper;
import com.ymttest.utils.BaofooSignature;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 支付异步回调接口 FreeMaker Template自动生成代码 回调主要验证微信JSAPI APP 支付宝PC APP场景 验证签名 返回码 支付号
 * 金额 商户号 异常情况
 * 验证不同渠道PayRecharge,PostPay,Recharge,SellerMarginRecharge,SellerRecharge资金流水
 */
@TestSuite
public class Ts_Notify {
	private static WeiXinNotifyBean wxnotifyBean;
	private static AliPayNotifyBean alinotifyBean;
	private static ApplePayNotifyBean applyPayNotifyBean;
	private static NotifyCall notifyCall;
	private static NotifyCall notifyCall50;
	private static CMBNotifyBean cmbNotifyBean;
	private static HipoNotifyBean hipoNotifyBean;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("支付异步回调接口");
	}

	@Before
	public void caseUp() {
		wxnotifyBean = new WeiXinNotifyBean();
		alinotifyBean = new AliPayNotifyBean();
		notifyCall = new NotifyCall();
		applyPayNotifyBean = new ApplePayNotifyBean();
		hipoNotifyBean=new HipoNotifyBean();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(notifyCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_001() {
		Logger.start(true, "10支付宝PC支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, alinotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("Alipay2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("Alipay", body.get("payChannel").toString(), "验证payChannel");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_002() {
		Logger.start(true, "11.支付宝WAP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("11");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			AliPayWapNotifyBean aliwap = PayGateWayCallService.initAliPayWapNotify(aqb);
			String send = PayGateWayCallService.signAliWapNotify(aliwap);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyWapDB(aqb, aliwap);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_003() {
		Logger.start(true, "13.支付宝-APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_004() {
		Logger.start(true, "14.微信JSAPI支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("Weixin2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_005() {
		Logger.start(true, "15.微信APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_006() {
		Logger.start(false, "10支付宝PC支付签名错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("AliPayNotifyBean加签并转换为SendString，设置sign错误");
			// 排序加签名
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			alinotifyBean.setSign(sign + 1);
			alinotifyBean.setSign_type("RSA");
			// 转换成最终发出的数据
			String send = FormatUtil.beanToHttpString(alinotifyBean, true);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_007() {
		Logger.start(false, "10支付宝PC支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置错误的Out_trade_no:123");
			alinotifyBean.setOut_trade_no("123");
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_008() {
		Logger.start(false, "10支付宝PC支付Out_trade_no不输入,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置Out_trade_no:null");
			alinotifyBean.setOut_trade_no(null);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_009() {
		Logger.start(false, "13.支付宝-APP支付签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("AliPayNotifyBean加签并转换为SendString，设置sign错误");
			// 排序加签名
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			alinotifyBean.setSign(sign + 1);
			alinotifyBean.setSign_type("RSA");
			// 转换成最终发出的数据
			String send = FormatUtil.beanToHttpString(alinotifyBean, true);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_010() {
		Logger.start(false, "13.支付宝-APP支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置错误的Out_trade_no:123");
			alinotifyBean.setOut_trade_no("123");
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_011() {
		Logger.start(false, "13.支付宝-APP支付不输入Out_trade_no,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			Logger.comment("设置错误的Out_trade_no:null");
			alinotifyBean.setOut_trade_no(null);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_012() {
		Logger.start(false, "14.微信JSAPI支付签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			// 排序加签名
			String src = FormatUtil.beanToHttpString(wxnotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			Logger.comment("设置签名错误");
			wxnotifyBean.setSign(sign + 1);
			// 转换成最终发出的数据
			String send = FormatUtil.beanToXmlString(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_013() {
		Logger.start(false, "14.微信JSAPI支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_014() {
		Logger.start(false, "14.微信JSAPI支付MerchantId错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_015() {
		Logger.start(false, "14.微信JSAPI支付ResultCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setResult_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_016() {
		Logger.start(false, "14.微信JSAPI支付ReturnCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setReturn_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_017() {
		Logger.start(false, "14.微信JSAPI支付TransactionID空值,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTransaction_id(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_018() {
		Logger.start(false, "14.微信JSAPI支付TotalFee小于0,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee("-1");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_019() {
		Logger.start(false, "14.微信JSAPI支付Out_trade_no为空,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_020() {
		Logger.start(false, "15.微信APP支付签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			// 排序加签名
			String src = FormatUtil.beanToHttpString(wxnotifyBean, false);
			String sign = SignSHA1WithRSA(src);
			Logger.comment("设置签名错误");
			wxnotifyBean.setSign(sign + 1);
			// 转换成最终发出的数据
			String send = FormatUtil.beanToXmlString(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_021() {
		Logger.start(false, "15.微信APP支付Out_trade_no错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_022() {
		Logger.start(false, "15.微信APP支付MerchantId错误,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id("123");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_023() {
		Logger.start(false, "15.微信APP支付ResultCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setResult_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_024() {
		Logger.start(false, "15.微信APP支付ReturnCode失败,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setReturn_code("FAIL");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_025() {
		Logger.start(false, "15.微信APP支付TransactionID空值,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTransaction_id(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_026() {
		Logger.start(false, "15.微信APP支付TotalFee小于0,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee("-1");
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_027() {
		Logger.start(false, "15.微信APP支付Out_trade_no为空,异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOut_trade_no(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_028() {
		Logger.start(false, "10支付宝PC支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setTotal_fee(alinotifyBean.getTotal_fee() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_029() {
		Logger.start(false, "13.支付宝-APP支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setTotal_fee(alinotifyBean.getTotal_fee() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_030() {
		Logger.start(false, "14.微信JSAPI支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee(wxnotifyBean.getTotal_fee() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_031() {
		Logger.start(false, "15.微信APP支付金额错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setTotal_fee(wxnotifyBean.getTotal_fee() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_032() {
		Logger.start(true, "收单时bizcode1，10支付宝PC支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_033() {
		Logger.start(true, "收单时bizcode2，10支付宝PC支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_034() {
		Logger.start(true, "收单时bizcode3，10支付宝PC支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_035() {
		Logger.start(true, "收单时bizcode4，10支付宝PC支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_036() {
		Logger.start(true, "收单时bizcode5，10支付宝PC支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_037() {
		Logger.start(true, "收单时bizcode1，13.支付宝-APP支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_038() {
		Logger.start(true, "收单时bizcode2，13.支付宝-APP支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_039() {
		Logger.start(true, "收单时bizcode3，13.支付宝-APP支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_040() {
		Logger.start(true, "收单时bizcode4，13.支付宝-APP支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_041() {
		Logger.start(true, "收单时bizcode5，13.支付宝-APP支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_042() {
		Logger.start(true, "收单时bizcode1，14微信JSAPI支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_043() {
		Logger.start(true, "收单时bizcode2，14微信JSAPI支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_044() {
		Logger.start(true, "收单时bizcode3，14微信JSAPI支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_045() {
		Logger.start(true, "收单时bizcode4，14微信JSAPI支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_046() {
		Logger.start(true, "收单时bizcode5，14微信JSAPI支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_047() {
		Logger.start(true, "收单时bizcode1，15微信APP支付异步回调校验PostPay100002补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("1");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	@Ignore
	// bizcode2 此业务废弃
	public void Tc_Notify_048() {
		Logger.start(true, "收单时bizcode2，15微信APP支付异步回调校验Recharge100003现金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("2");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_049() {
		Logger.start(true, "收单时bizcode3，15微信APP支付异步回调校验PayRecharge100001定金充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("3");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_050() {
		Logger.start(true, "收单时bizcode4，15微信APP支付异步回调校验SellerMarginRecharge100003卖家保证金充值补款充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("4");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_051() {
		Logger.start(true, "收单时bizcode5，15微信APP支付异步回调校验SellerRecharge100003卖家余额充值成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			aqb.setBizCode("5");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_052() {
		Logger.start(true, "10支付宝PC输入错误商户号支付异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setSeller_id(alinotifyBean.getSeller_id() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();

			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_053() {
		Logger.start(true, "11.支付宝WAP支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("11");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			AliPayWapNotifyBean aliwap = PayGateWayCallService.initAliPayWapNotify(aqb);
			aliwap.setSeller_id(aliwap.getSeller_id() + 1);
			String send = PayGateWayCallService.signAliWapNotify(aliwap);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_054() {
		Logger.start(true, "13.支付宝-APP支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setSeller_id(alinotifyBean.getSeller_id() + 1);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_055() {
		Logger.start(true, "14.微信JSAPI支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id(wxnotifyBean.getMch_id() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_056() {
		Logger.start(true, "15.微信APP支付输入错误商户号异步回调失败JIRACONN-4583");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setMch_id(wxnotifyBean.getMch_id() + 1);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证failed");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_057() {
		Logger.start(true, "50招行支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall50 notifyCall50 = new NotifyCall50();
			cmbNotifyBean = PayGateWayCallService.initCMBNotifyBean(aqb, "0");
			String sign = PayGateWayCallService.SignCMBNoticeData(cmbNotifyBean.getNoticeData());
			cmbNotifyBean.setSign(sign);
			String send = PayGateWayCallService.CMBNoticeSendString(cmbNotifyBean);
			// alinotifyBean = initAliPayNotifyBean(aqb);
			// String send = aliPayNotifyBeanToSend(alinotifyBean,aqb);
			notifyCall50.setData(send);
			notifyCall50.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall50.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall50.callService();

			Logger.verifyEquals("success", notifyCall50.getReturnData(), "验证success");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			verifyDB(aqb, cmbNotifyBean);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_email(),
				// body.get("externalUserId").toString(), "验证externalUserId");
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_id(),
				// body.get("externalPayerId").toString(), "验证externalPayerId");
				// Logger.verifyEquals(
				// Double.valueOf(cmbNotifyBean.getPrice()),
				// Double.valueOf(body.get("payPrice").toString()),
				// "验证payPrice");
				Logger.verifyEquals(cmbNotifyBean.getNoticeData().getOrderNo(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("CmbPay", body.get("payChannel").toString(), "验证payChannel");

			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_058() {
		Logger.start(true, "50招行支付异步回调成功,有优惠金额");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("50");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall50 notifyCall50 = new NotifyCall50();
			cmbNotifyBean = PayGateWayCallService.initCMBNotifyBean(aqb, "1");
			String sign = PayGateWayCallService.SignCMBNoticeData(cmbNotifyBean.getNoticeData());
			cmbNotifyBean.setSign(sign);
			String send = PayGateWayCallService.CMBNoticeSendString(cmbNotifyBean);
			// alinotifyBean = initAliPayNotifyBean(aqb);
			// String send = aliPayNotifyBeanToSend(alinotifyBean,aqb);
			notifyCall50.setData(send);
			notifyCall50.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall50.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall50.callService();

			Logger.verifyEquals("success", notifyCall50.getReturnData(), "验证success");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			verifyDB(aqb, cmbNotifyBean);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_email(),
				// body.get("externalUserId").toString(), "验证externalUserId");
				// Logger.verifyEquals(cmbNotifyBean.getBuyer_id(),
				// body.get("externalPayerId").toString(), "验证externalPayerId");
				// Logger.verifyEquals(
				// Double.valueOf(cmbNotifyBean.getPrice()),
				// Double.valueOf(body.get("payPrice").toString()),
				// "验证payPrice");
				Logger.verifyEquals(cmbNotifyBean.getNoticeData().getOrderNo(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("CmbPay", body.get("payChannel").toString(), "验证payChannel");

			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_059() {
		Logger.start(true, "16.微信扫描支付异步回调成功,openid为空");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("16");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOpenid(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_060() {
		Logger.start(true, "60ApplePay支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_061() {
		Logger.start(false, "60ApplePay回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_062() {
		Logger.start(false, "60ApplePay签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_063() {
		Logger.start(true, "60ApplePay支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_064() {
		Logger.start(false, "60ApplePay回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_065() {
		Logger.start(false, "60ApplePay回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("60");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_066() {
		Logger.start(true, "70宝付支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("OK", notifyCall70.getReturnData(), "验证success");

			verifyDB(aqb, baofu);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			for (Map mock : mocks) {
				// //{\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(baofu.getSucc_amt(), bprice.toString(), "验证payPrice");
				Logger.verifyEquals(baofu.getTrans_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("BaofooPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(baofu.getOrder_id(), body.get("instPaymentId").toString(), "验证instPaymentId");
				// Logger.verifyEquals("MD5", body.get("signMethod").toString(),
				// "验证signMethod");
				//
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_067() {
		Logger.start(false, "70宝付支付金额不一致异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setSucc_amt(baofu.getSucc_amt() + 1);
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_068() {
		Logger.start(false, "70宝付加密错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setSucc_amt(baofu.getSucc_amt());
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=1" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_069() {
		Logger.start(false, "70宝付回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setResp_code("9999");
			baofu.setResp_msg("未知异常");
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_070() {
		Logger.start(false, "70宝付回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setTrans_id("-111111");
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_071() {
		Logger.start(false, "70宝付回调商户号不匹配,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("70");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			NotifyCall70 notifyCall70 = new NotifyCall70();
			BaoFuNotifyBean baofu = PayGateWayCallService.initBaoFuNotifyBean(aqb);
			baofu.setMember_id("111");
			BaofooSignature bf = new BaofooSignature();
			String send = "data_content=" + bf.encryptData(FormatUtil.beanToGSONString(baofu));
			notifyCall70.setData(send);
			notifyCall70.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall70.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall70.callService();
			Logger.verifyEquals("failed", notifyCall70.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_072() {
		Logger.start(true, "收单时bizcode15，10支付宝PC支付异步回调校验卖家拼邮溯源保证金支付充值101503_JIRACONN-15218(0921bizcode6改15)");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("15");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_073() {
		Logger.start(true, "10支付宝PC支付RSA加密异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSendPCRSA(alinotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, alinotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("Alipay2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("Alipay", body.get("payChannel").toString(), "验证payChannel");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_074() {
		Logger.start(true, "11.支付宝WAP支付使用RSA加密异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("11");
			aqb.setSignMethod("RSA");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			AliPayWapNotifyBean aliwap = PayGateWayCallService.initAliPayWapNotify(aqb);
			String send = PayGateWayCallService.signRSAAliWapNotify(aliwap);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyWapDB(aqb, aliwap);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_075() {
		Logger.start(true, "9.支付宝-花呗支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("AliPayHbfq2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("AliPayHbfq", body.get("payChannel").toString(), "验证payChannel");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_076() {
		Logger.start(true, "9.支付宝-花呗支付不输入hb_fq_param失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_077() {
		Logger.start(true, "9.支付宝-花呗新增字段out_channel_type识别是否真正的花呗支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("PCREDIT_CC_PCREDIT_INSTALLMENT");
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_078() {
		Logger.start(true, "9.支付宝-花呗新增字段out_channel_type不是花呗修改支付type为13");
		try {
			//这个场景需要看9和1009 2个场景
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("BALANCE");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_079() {
		Logger.start(true, "9.支付宝-花呗新增字段out_channel_type不输入不修改");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type(null);
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_080() {
		Logger.start(true, "9.支付宝-花呗状态为WAIT_BUYER_PAY不修改type");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setTrade_status("WAIT_BUYER_PAY");
			alinotifyBean.setOut_channel_type(null);
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	// 等待支付状态不能修改支付状态
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_081() {
		Logger.start(true, "13.支付宝状态为WAIT_BUYER_PAY时支付状态为Init");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setTrade_status("WAIT_BUYER_PAY");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_082() {
		Logger.start(true, "收单时bizcode17，10支付宝PC支付异步回调校验-全球买手专项保证金（支付宝付款）");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("17");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_083() {
		Logger.start(true, "收单时bizcode16，10支付宝PC支付异步回调校验-黑五专项保证金（支付宝付款）");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("16");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_084() {
		Logger.start(true, "0.支付宝-MOCK支付异步回调成功");
		try {
			boolean tempoyy=true;
			PayGateWayCallService.OpenYangYi=false;
			PayGateWayCallService.initYMatouMERID();
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("0");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
			PayGateWayCallService.OpenYangYi=tempoyy;
			if(PayGateWayCallService.OpenYangYi){
				PayGateWayCallService.initYangYiMERID();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_085() {
		Logger.start(true, "17.微信APP小程序支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("17");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PaymentDefaultWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("Weixin2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
				}
			}
			Logger.comment("微信小程序验证mq");
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			MessageListBean MessageListBean = MqQueryCallService.initMiniAppPaynotify(wxnotifyBean.getOut_trade_no());
			List<Map> mqmsg = MqQueryCallService.GetMqMessage(MessageListBean);
			Logger.verifyEquals(true, mqmsg.size() == 1, "验证总线消息");
			Logger.verifyEquals(ppm.getPayerId(), mqmsg.get(0).get("openId"), "验证openid");
			Logger.verifyEquals(ppm.getInstProxyPaymentId(), mqmsg.get(0).get("prePayId"), "验证prePayId");
			Logger.verifyEquals(ppm.getTradingId(), mqmsg.get(0).get("tradingId"), "验证tradingId");
			Logger.verifyEquals(ppm.getUserId(), mqmsg.get(0).get("userId"), "验证userId");
			Logger.verifyEquals(YMTDateUtil.getFormatTime(ppm.getPayTime(), "yyyy-MM-dd HH:mm:ss"), mqmsg.get(0).get("payTime"), "验证PayTime");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_086() {
		//18不走洋漪
		Logger.start(true, "18直播微店支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("18");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			// wxnotifyBean.setMch_id(PayGateWayCallService.WX_App_merchantId);
			// wxnotifyBean.setAppid(PayGateWayCallService.WX_AppID);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PaymentDefaultWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
//				if(PayGateWayCallService.OpenYangYi){
//					Logger.verifyEquals("Weixin2", body.get("payChannel").toString(), "验证payChannel");
//				}else{
					Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
//				}
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_087() {
		Logger.start(true, "17.微信APP小程序支付异步回调异常mq不发送");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("17");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			// 不在重复查询
			new PayGateWayWapper().updateInstProxyPaymentIdNull(wxnotifyBean.getOut_trade_no());
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PaymentDefaultWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("Weixin2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
				}
			}
			Logger.comment("微信小程序验证mq");
			MessageListBean MessageListBean = MqQueryCallService.initMiniAppPaynotify(wxnotifyBean.getOut_trade_no());
			List<Map> mqmsg = MqQueryCallService.GetMqMessage(MessageListBean);
			Logger.verifyEquals(true, mqmsg.size() == 0, "验证总线消息");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_088() {
		Logger.start(true, "19海外直播扫货微信APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("19");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_089() {
		Logger.start(true, "80翼支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			BestPayNotifyBean BestPayNotifyBean = initBestPayNotifyBean(aqb);
			String send = bestNotifyBeanToSend(BestPayNotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("UPTRANSEQ_" + BestPayNotifyBean.getUPTRANSEQ(), notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, BestPayNotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_090() {
		Logger.start(true, "80翼支付异步回输入错误订单号失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			BestPayNotifyBean BestPayNotifyBean = initBestPayNotifyBean(aqb);
			BestPayNotifyBean.setORDERSEQ("1");
			String send = bestNotifyBeanToSend(BestPayNotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_091() {
		Logger.start(true, "80翼支付异步回输入错误金额");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			BestPayNotifyBean BestPayNotifyBean = initBestPayNotifyBean(aqb);
			BestPayNotifyBean.setORDERAMOUNT(1 + aqb.getPayPrice());
			String send = bestNotifyBeanToSend(BestPayNotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_092() {
		Logger.start(true, "80翼支付异步回输入错误商户号");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("80");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			BestPayNotifyBean BestPayNotifyBean = initBestPayNotifyBean(aqb);
			BestPayNotifyBean.setMERCHANTID("1");
			String send = bestNotifyBeanToSend(BestPayNotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_093() {
		Logger.start(true, "兼容场景9.支付宝-花呗新增字段out_channel_type不是花呗修改支付type为13(不受1009影响)");
		try {
			//这个场景需要看9和1009 2个场景
			boolean tempyy=true;
			PayGateWayCallService.OpenYangYi=false;
			PayGateWayCallService.initYMatouMERID();
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("9");
			Integer installmentNum = 3;
			aqb.setInstallmentNum(installmentNum);
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("BALANCE");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.addHeader("MockPayTypeRouter", "Disable");
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
			PayGateWayCallService.OpenYangYi=tempyy;
			if(tempyy){
				PayGateWayCallService.initYangYiMERID();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_094() {
		Logger.start(true, "62upay-app支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("UnionPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_095() {
		Logger.start(false, "62upay-app回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_096() {
		Logger.start(false, "62upay-app签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_097() {
		Logger.start(true, "62upay-app支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("UnionPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_098() {
		Logger.start(false, "62upay-app回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_099() {
		Logger.start(false, "62upay-app回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("62");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_100() {
		Logger.start(true, "63upay-wap支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("UnionPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_101() {
		Logger.start(false, "63upay-wap回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_102() {
		Logger.start(false, "63upay-wap签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_103() {
		Logger.start(true, "63upay-wap支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("UnionPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_104() {
		Logger.start(false, "63upay-wap回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_105() {
		Logger.start(false, "63upay-wap回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("63");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_106() {
		Logger.start(true, "64小米支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("MiPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_107() {
		Logger.start(false, "64小米回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_108() {
		Logger.start(false, "64小米签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_109() {
		Logger.start(true, "64小米支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("MiPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_110() {
		Logger.start(false, "64小米回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_111() {
		Logger.start(false, "64小米回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("64");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_112() {
		Logger.start(true, "16.微信扫描支付异步回调成功,微信立减优惠");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("16");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			BigDecimal discountAmt=new BigDecimal("1.00").setScale(2);
			String settle=new BigDecimal(aqb.getPayPrice()).subtract(discountAmt).multiply(BigDecimal.valueOf(100)).setScale(0).toString();
			wxnotifyBean.setSettlement_total_fee(settle);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			//[{FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975931, CreateTime=2018-10-23 18:13:04.373, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody={"code":200}}, {FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975930, CreateTime=2018-10-23 18:13:04.37, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody=OK}]
			Logger.verifyEquals(true, mocks.get(0).get("Body").toString().contains("discountAmt\":\""+discountAmt.toString()+"\""), "验证包含数据discountAmt");
			Logger.verifyEquals("NotifyTradingEvent", mocks.get(0).get("FunctionName"), "验证事件NotifyTradingEvent");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_113() {
		Logger.start(true, "14.微信jsapi异步回调成功,微信立减优惠");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("14");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			BigDecimal discountAmt=new BigDecimal("1.00").setScale(2);
			String settle=new BigDecimal(aqb.getPayPrice()).subtract(discountAmt).multiply(BigDecimal.valueOf(100)).setScale(0).toString();
			wxnotifyBean.setSettlement_total_fee(settle);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			//[{FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975931, CreateTime=2018-10-23 18:13:04.373, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody={"code":200}}, {FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975930, CreateTime=2018-10-23 18:13:04.37, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody=OK}]
			Logger.verifyEquals(true, mocks.get(0).get("Body").toString().contains("discountAmt\":\""+discountAmt.toString()+"\""), "验证包含数据discountAmt");
			Logger.verifyEquals("NotifyTradingEvent", mocks.get(0).get("FunctionName"), "验证事件NotifyTradingEvent");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_114() {
		Logger.start(true, "14.微信app异步回调成功,微信立减优惠");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("15");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			BigDecimal discountAmt=new BigDecimal("1.00").setScale(2);
			String settle=new BigDecimal(aqb.getPayPrice()).subtract(discountAmt).multiply(BigDecimal.valueOf(100)).setScale(0).toString();
			wxnotifyBean.setSettlement_total_fee(settle);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			//[{FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975931, CreateTime=2018-10-23 18:13:04.373, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody={"code":200}}, {FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975930, CreateTime=2018-10-23 18:13:04.37, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody=OK}]
			Logger.verifyEquals(true, mocks.get(0).get("Body").toString().contains("discountAmt\":\""+discountAmt.toString()+"\""), "验证包含数据discountAmt");
			Logger.verifyEquals("NotifyTradingEvent", mocks.get(0).get("FunctionName"), "验证事件NotifyTradingEvent");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_115() {
		Logger.start(true, "16.微信扫描支付异步回调,微信立减优惠,优惠金额大于支付金额失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("16");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			BigDecimal discountAmt=new BigDecimal("200.00").setScale(2);
			String settle=new BigDecimal(aqb.getPayPrice()).subtract(discountAmt).multiply(BigDecimal.valueOf(100)).setScale(0).toString();
			wxnotifyBean.setSettlement_total_fee(settle);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
//			verifyDB(aqb, wxnotifyBean);
//			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
//			//[{FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975931, CreateTime=2018-10-23 18:13:04.373, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody={"code":200}}, {FunctionName=NotifyTradingEvent, AppId=TradingService, Header=Connection=Keep-Alive&Accept-Encoding=gzip;deflate&Host=mockforpay.iapi.ymatou.com&User-Agent=Apache-HttpClient/4.5.2;(Java/1.8.0_91)&mock=1&mockid=dec9c728-e033-4055-814f-6aeafe650f87, Query=, ResponseStatus=200, MockRecordId=975930, CreateTime=2018-10-23 18:13:04.37, MockId=dec9c728-e033-4055-814f-6aeafe650f87, Method=POST, Body={"appId":"2","bizCode":"3","discountAmt":"5.00","externalPayerId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","externalUserId":"oR5W7jgCy4FEyW4m05RiCk81Eiyw","instPaymentId":"feeba5901362486ab7c867567314c10","internalUserId":"20336470","memo":"","payChannel":"Weixin2","payPrice":"6.00","payTime":"20181023181304","payType":"1016","paymentId":"18102318130494423","sign":"A6D1E60F6D40A62E087A46CD876DC936","signMethod":"MD5","traceId":"e10f3dbf-00f3-4195-ae8f-9364f935b6dd","tradingId":"115140582908374","version":1}, Url=http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent, ResponseBody=OK}]
//			Logger.verifyEquals(true, mocks.get(0).get("Body").toString().contains("discountAmt\":\""+discountAmt.toString()+"\""), "验证包含数据discountAmt");
//			Logger.verifyEquals("NotifyTradingEvent", mocks.get(0).get("FunctionName"), "验证事件NotifyTradingEvent");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_116() {
		Logger.start(true, "3013.全球优选-支付宝App支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3013");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_117() {
		Logger.start(true, "3017.全球优选-微信APP小程序支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3017");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PaymentDefaultWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
			}
			Logger.comment("微信小程序验证mq");
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			MessageListBean MessageListBean = MqQueryCallService.initMiniAppPaynotify(wxnotifyBean.getOut_trade_no());
			List<Map> mqmsg = MqQueryCallService.GetMqMessage(MessageListBean);
			Logger.verifyEquals(true, mqmsg.size() == 1, "验证总线消息");
			Logger.verifyEquals(ppm.getPayerId(), mqmsg.get(0).get("openId"), "验证openid");
			Logger.verifyEquals(ppm.getInstProxyPaymentId(), mqmsg.get(0).get("prePayId"), "验证prePayId");
			Logger.verifyEquals(ppm.getTradingId(), mqmsg.get(0).get("tradingId"), "验证tradingId");
			Logger.verifyEquals(ppm.getUserId(), mqmsg.get(0).get("userId"), "验证userId");
			Logger.verifyEquals(YMTDateUtil.getFormatTime(ppm.getPayTime(), "yyyy-MM-dd HH:mm:ss"), mqmsg.get(0).get("payTime"), "验证PayTime");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_118() {
		Logger.start(true, "3015.全球优选-微信APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3015");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	//6 预售订单充值
	public void Tc_Notify_119() {
		Logger.start(true, "收单时bizcode6，10支付宝PC支付异步回调校验预售定金充值100007成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("6");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_120() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoNotifyBean.setCurrency("CNY");//rmb
			hipoNotifyBean.setSettle_currency("HKD");
			hipoNotifyBean.setPay_currency("CNY");
			//对应case167 在Currency为CNY的时候通知交易的orderRmb取aqb.getPayPrice()
			String pay_amount=new BigDecimal(aqb.getPayPrice().toString()).add(BigDecimal.valueOf(1d)).setScale(2).toString();
			hipoNotifyBean.setPay_amount(pay_amount);
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		            Logger.verifyEquals(new BigDecimal(body.get("orderRmb").toString()).setScale(2), new BigDecimal(aqb.getPayPrice()).setScale(2), "验证orderRmb");

		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_121() {
		Logger.start(true, "65.HuaweiPay支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("HuaweiPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_122() {
		Logger.start(false, "65.HuaweiPay回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_123() {
		Logger.start(false, "65.HuaweiPay签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_124() {
		Logger.start(true, "65.HuaweiPay支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("HuaweiPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_125() {
		Logger.start(false, "65.HuaweiPay回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_126() {
		Logger.start(false, "65.HuaweiPay回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("65");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_127() {
		Logger.start(true, "66.SamSungPay支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			aqb.setPayPrice("2.05");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Integer bprice = new BigDecimal(body.get("payPrice").toString()).multiply(new BigDecimal(100)).intValue();
				Logger.verifyEquals(applyPayNotifyBean.getTxnAmt(), bprice, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("SamSungPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_128() {
		Logger.start(false, "66.SamSungPay回调金额不一致支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setSettleAmt(applyPayNotifyBean.getSettleAmt() + 1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_129() {
		Logger.start(false, "66.SamSungPay签名错误异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			send += 1;
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_130() {
		Logger.start(true, "66.SamSungPay支付异步回调成功,返回code为A6");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("A6");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("ok", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, applyPayNotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);

			Logger.debug("mocks:" + FormatUtil.beanToGSONString(mocks));
			for (Map mock : mocks) {
				// {\"appId\":\"2\",\"bizCode\":\"3\",\"currency\":\"CNY\",\"discountAmt\":\"0.00\",\"externalPayerId\":\"\",\"instPaymentId\":\"85a946abf617497aaee83fb323f18e86\",\"internalUserId\":\"30152658\",\"memo\":\"备注:541\",\"payChannel\":\"60\",\"payPrice\":\"5.00\",\"payTime\":\"20170504142225\",\"payType\":\"60\",\"paymentId\":\"17050414222238611\",\"sign\":\"CA7FF74741A213939FBA7A369A2AD924\",\"signMethod\":\"MD5\",\"traceId\":\"b747f109-7a6f-42c3-9f8c-30c8638ecfef\",\"tradingId\":\"685976793843683\",\"version\":1}
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(Double.valueOf(applyPayNotifyBean.getTxnAmt()), Double.valueOf(body.get("payPrice").toString()) * 100, "验证payPrice");
				Logger.verifyEquals(applyPayNotifyBean.getOrderId(), body.get("paymentId").toString(), "验证paymentId");
//				Logger.verifyEquals("ApplePay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(applyPayNotifyBean.getQueryId(), body.get("instPaymentId").toString(), "验证instPaymentId");
				Logger.verifyEquals("MD5", body.get("signMethod").toString(), "验证signMethod");
				Logger.verifyEquals("SamSungPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_131() {
		Logger.start(false, "66.SamSungPay回调code非成功,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setRespCode("12");
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_132() {
		Logger.start(false, "66.SamSungPay回调订单不存在,返回failed");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("66");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			applyPayNotifyBean = initApplePayNotifyBean(aqb);
			applyPayNotifyBean.setMerId(PayGateWayCallService.UPAY_MERID);
			applyPayNotifyBean.setOrderId(TestDataManager.getRandomUUID().toString());
			// TxnAmt不校验？
			// applyPayNotifyBean.setTxnAmt(applyPayNotifyBean.getTxnAmt()+1);
			String send = applyPayNotifyBeanToSend(applyPayNotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_133() {
		Logger.start(false, "6000HipoPayWxApp支付回调金额错误失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoNotifyBean.setCurrency("HKD");
			hipoNotifyBean.setAmount(1+aqb.getPayPrice());
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("failed", hipoPayNotifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_134() {
		Logger.start(false, "6000HipoPayWxApp支付回调验签失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoNotifyBean.setCurrency("HKD");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("failed", hipoPayNotifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_135() {
		Logger.start(true, "8.支付宝-花呗支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("8");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("PCREDIT_PAY");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("AliPayHb", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_136() {
		Logger.start(true, "8.支付宝-花呗新增字段out_channel_type不是花呗修改支付type为13");
		try {
			//这个场景需要看9和1009 2个场景
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("8");
			boolean tempyy=true;
			PayGateWayCallService.OpenYangYi=false;
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = PayGateWayCallService.initAliPayNotifyBean(aqb);
			alinotifyBean.setOut_channel_type("BALANCE");
			String send = PayGateWayCallService.aliPayNotifyBeanToSend(alinotifyBean, aqb.getPayType());
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
			PayGateWayCallService.OpenYangYi=tempyy;
			if(tempyy){
				PayGateWayCallService.initYangYiMERID();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_137() {
		Logger.start(true, "收单时bizcode19，10支付宝PC支付异步回调校验-19 直播保证金");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("19");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_138() {
		Logger.start(true, "收单时bizcode20，10支付宝PC支付异步回调校验-20 高客单价保证金");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			aqb.setBizCode("20");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_139() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-HK外币标价");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,"1");
			hipoNotifyBean.setCurrency("HKD");
			hipoNotifyBean.setSettle_currency("HKD");
			BigDecimal orderRmb=new BigDecimal(aqb.getPayPrice()).divide(new BigDecimal(PayGateWayCallService.HKExchangeRate),2,BigDecimal.ROUND_DOWN);
			Logger.comment("orderRmb:"+orderRmb);
			hipoNotifyBean.setPay_amount(orderRmb.toString());
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		            Logger.verifyEquals(hipoNotifyBean.getPay_amount(), body.get("orderRmb").toString(), "验证orderRmb");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_140() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-HK外币标价-返回汇率不为1时报错");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,"2");
			hipoNotifyBean.setCurrency("HKD");
			hipoNotifyBean.setSettle_currency("HKD");
			BigDecimal orderRmb=new BigDecimal(aqb.getPayPrice()).divide(new BigDecimal(PayGateWayCallService.HKExchangeRate),2,BigDecimal.ROUND_DOWN);
			Logger.comment("orderRmb:"+orderRmb);
			hipoNotifyBean.setPay_amount(orderRmb.toString());
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("failed", hipoPayNotifyCall.getReturnData(), "验证success");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		            Logger.verifyEquals(hipoNotifyBean.getPay_amount(), body.get("orderRmb").toString(), "验证orderRmb");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_141() {
		Logger.start(false, "6001HipoPayWxH5支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoH5NotifyBean.setCurrency("CNY");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoH5NotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoH5NotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoH5NotifyBean.getAgent_order_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoH5NotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoH5NotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_142() {
		Logger.start(false, "6001HipoPayWxH5支付回调成功-HK外汇标价");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,"1");
			hipoH5NotifyBean.setCurrency("HKD");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoH5NotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoH5NotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoH5NotifyBean.getAgent_order_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoH5NotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoH5NotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_143() {
		Logger.start(false, "6001HipoPayWxH5支付金额错误失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoH5NotifyBean.setCurrency("CNY");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			hipoH5NotifyBean.setAmount(1+aqb.getPayPrice());
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("failed", hipoPayNotifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_144() {
		Logger.start(false, "6001HipoPayWxH5签名错误失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoH5NotifyBean.setCurrency("CNY");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			hipoH5NotifyBean.setAmount(aqb.getPayPrice());
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
//			hipoPayNotifyCall.addHeader("Mock", "1");
//			String mockid = TestDataManager.getRandomUUID().toString();
//			hipoPayNotifyCall.addHeader("MockId", mockid);
//			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("failed", hipoPayNotifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_145() {
		Logger.start(false, "6001HipoPayWxH5支付外汇标价返回汇率不为1失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6001");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,"2");
			hipoH5NotifyBean.setCurrency("HKD");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("failed", hipoPayNotifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_146() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-HK外币标价-独立小程序app");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			aqb.setAppName(PayGateWayCallService.PayGdSq.toString());
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,"1");
			hipoNotifyBean.setCurrency("HKD");
			hipoNotifyBean.setSettle_currency("HKD");
			BigDecimal orderRmb=new BigDecimal(aqb.getPayPrice()).divide(new BigDecimal(PayGateWayCallService.HKExchangeRate),2,BigDecimal.ROUND_DOWN);
			Logger.comment("orderRmb:"+orderRmb);
			hipoNotifyBean.setPay_amount(orderRmb.toString());
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		            Logger.verifyEquals(hipoNotifyBean.getPay_amount(), body.get("orderRmb").toString(), "验证orderRmb");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_147() {
		Logger.start(true, "10支付宝PC支付异步回调成功-如果不是补单成功统一把CheckStatus设置为0");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("10");
			PayGateWayCallService.acquireOrder(aqb);
			PayGateWayWapper PayGateWayWapper=new PayGateWayWapper();
			MPayment ppm = PayGateWayWapper.selectPaymentByTradingid(aqb.getOrderId()).get(0);
			PayGateWayWapper.updateCheckStatus(ppm.getPaymentId(), "-1");
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, alinotifyBean);
			ppm = PayGateWayWapper.selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyEquals(0, ppm.getCheckStatus(), "验证checkstatus归零");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("Alipay2", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("Alipay", body.get("payChannel").toString(), "验证payChannel");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_148() {
		Logger.start(true, "3113.全球优选-支付宝App支付异步回调成功-Cloud");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3113");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_149() {
		Logger.start(true, "3117.全球优选-微信APP小程序支付异步回调成功-Cloud");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3117");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
			List<Map> mocks = new PaymentDefaultWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(wxnotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("Weixin", body.get("payChannel").toString(), "验证payChannel");
			}
			Logger.comment("微信小程序验证mq");
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			MessageListBean MessageListBean = MqQueryCallService.initMiniAppPaynotify(wxnotifyBean.getOut_trade_no());
			List<Map> mqmsg = MqQueryCallService.GetMqMessage(MessageListBean);
			Logger.verifyEquals(true, mqmsg.size() == 1, "验证总线消息");
			Logger.verifyEquals(ppm.getPayerId(), mqmsg.get(0).get("openId"), "验证openid");
			Logger.verifyEquals(ppm.getInstProxyPaymentId(), mqmsg.get(0).get("prePayId"), "验证prePayId");
			Logger.verifyEquals(ppm.getTradingId(), mqmsg.get(0).get("tradingId"), "验证tradingId");
			Logger.verifyEquals(ppm.getUserId(), mqmsg.get(0).get("userId"), "验证userId");
			Logger.verifyEquals(YMTDateUtil.getFormatTime(ppm.getPayTime(), "yyyy-MM-dd HH:mm:ss"), mqmsg.get(0).get("payTime"), "验证PayTime");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_150() {
		Logger.start(true, "3115.全球优选-微信APP支付异步回调成功-Cloud");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3115");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_151() {
		Logger.start(true, "3213.全球优选-支付宝App支付异步回调成功-Cloud");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3213");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_152() {
		Logger.start(true, "3215.全球优选-微信APP支付异步回调成功-Cloud");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("3215");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_153() {
		Logger.start(true, "2013.抖音支付宝-APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("2013");
			PayGateWayCallService.acquireOrder(aqb);
			//2013使用13回调
			notifyCall = new NotifyCall("13");
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_154() {
		Logger.start(false, "6002HipoPayWxH5支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6002");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoH5NotifyBean.setCurrency("CNY");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoH5NotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoH5NotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoH5NotifyBean.getAgent_order_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoH5NotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoH5NotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_155() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-独立商家-执行支付成功回调通知成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			aqb.setPayPrice("2.14");
			aqb.setSettleCurrency("HKD");
			aqb.setPriceCurrency("HKD");
			aqb.setAppName(PayGateWayCallService.PayGdSq.toString());
			aqb.setNotifyUrl("http://mockforpay.iapi.ymatou.com/api/Trading/NotifyTradingEvent");
			PayGateWayCallService.acquireOrder(aqb);
			String pid = PayGateWayCallService.getPaymentId(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,"1");
			hipoNotifyBean.setCurrency("HKD");
			hipoNotifyBean.setSettle_currency("HKD");
			BigDecimal orderRmb=new BigDecimal(aqb.getPayPrice()).divide(new BigDecimal(PayGateWayCallService.HKExchangeRate),2,BigDecimal.ROUND_DOWN);
			Logger.comment("orderRmb:"+orderRmb);
			hipoNotifyBean.setPay_amount(orderRmb.toString());
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			Logger.debug(mockid+"::"+mocks.toString());
			for (Map map : mocks) {
				// 退款查询发送报文验证
				if (map.get("FunctionName").equals("NotifyTradingEvent")) {
					Map body =(Map) FormatUtil.GSONToObject(map.get("Body").toString(), Map.class);
//					{
//						"appId": "2",
//						"bizCode": "60",
//						"discountAmt": "0.00",
//						"externalPayerId": "owbCH5JFEZTRRnb8JKyLQtj3aWEk",
//						"externalUserId": "owbCH5JFEZTRRnb8JKyLQtj3aWEk",
//						"instPaymentId": "1e3efb293b114e36b42c3494404a382",
//						"internalUserId": "30252857",
//						"memo": "",
//						"merchantNo": "WC5c78d78282173",
//						"orderRmb": "2.14",
//						"payChannel": "HipoPay",
//						"payPrice": "2.14",
//						"payTime": "20191114152138",
//						"payType": "6000",
//						"paymentId": "19111415212996810",
//						"settleAmount": "2.14",
//						"settleCurrency": "HKD",
//						"settleRate": "1",
//						"sign": "FDF7A1DC4139BCC4DC89D8DB4CF526F3",
//						"signMethod": "MD5",
//						"traceId": "11562d56-1fc1-4a2c-bcd2-aa72d22e7c69",
//						"tradingId": "1387426562764553",
//						"version": 1
//					},
					Logger.debug(body);
					Logger.verifyEquals(aqb.getBizCode(), body.get("bizCode").toString(), "验证bizCode");
					Logger.verifyEquals(PayGateWayCallService.HipoPayWxAppOpenId, body.get("externalPayerId").toString(), "验证externalPayerId");
					Logger.verifyEquals(PayGateWayCallService.HipoPayWxAppOpenId, body.get("externalUserId").toString(), "验证externalPayerId");
					Logger.verifyNotNull(body.get("instPaymentId").toString(), "验证instPaymentId");
					Logger.verifyEquals(aqb.getUserId(), body.get("internalUserId").toString(), "验证internalUserId");
					Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, body.get("merchantNo").toString(), "验证merchantNo");
					//汇率换算 忽略
//					Logger.verifyEquals(aqb.getPayPrice(), body.get("orderRmb").toString(), "验证orderRmb");
					Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
					Logger.verifyEquals(aqb.getPayPrice(), body.get("payPrice").toString(), "验证payPrice");
					Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
					Logger.verifyEquals(pid, body.get("paymentId").toString(), "验证paymentId");
					Logger.verifyEquals(aqb.getPayPrice(), body.get("settleAmount").toString(), "验证settleAmount");
					Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
					MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(
							aqb.getOrderId()).get(0);
					Logger.verifyEquals(ppm.getTradingId(), body.get("tradingId").toString(), "验证tradingId");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_156() {
		Logger.start(true, "6010盛付通微信小程序支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6010");
			AcquireOrderCall acquireorderCall = PayGateWayCallService.acquireOrder(aqb);
			List<String> clist = acquireorderCall.getReqHeader();
			for (int i = 0; i < clist.size(); i++) {
				Logger.debug("1c:"+clist.get(i));
			}
			SFTNotifyBean sftb = PayGateWayCallService.initSFTNotifyBean(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			String send = PayGateWayCallService.SFTPayNotifyBeanToSend(sftb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("OK", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, sftb,"");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			Logger.debug(mockid+"::"+mocks.toString());
			for (Map map : mocks) {
				Map body =(Map) FormatUtil.GSONToObject(map.get("Body").toString(), Map.class);
				// 退款查询发送报文验证
				if (map.get("FunctionName").equals("NotifyTradingEvent")) {
//					{
//						"appId": "2",
//						"bizCode": "60",
//						"discountAmt": "0.00",
//						"externalPayerId": "owbCH5JFEZTRRnb8JKyLQtj3aWEk",
//						"externalUserId": "owbCH5JFEZTRRnb8JKyLQtj3aWEk",
//						"instPaymentId": "1e3efb293b114e36b42c3494404a382",
//						"internalUserId": "30252857",
//						"memo": "",
//						"merchantNo": "WC5c78d78282173",
//						"orderRmb": "2.14",
//						"payChannel": "HipoPay",
//						"payPrice": "2.14",
//						"payTime": "20191114152138",
//						"payType": "6000",
//						"paymentId": "19111415212996810",
//						"settleAmount": "2.14",
//						"settleCurrency": "HKD",
//						"settleRate": "1",
//						"sign": "FDF7A1DC4139BCC4DC89D8DB4CF526F3",
//						"signMethod": "MD5",
//						"traceId": "11562d56-1fc1-4a2c-bcd2-aa72d22e7c69",
//						"tradingId": "1387426562764553",
//						"version": 1
//					},
					Logger.debug(body);
					Logger.verifyEquals(aqb.getBizCode(), body.get("bizCode").toString(), "验证bizCode");
					Logger.verifyEquals(PayGateWayCallService.SFTWxOpenId, body.get("externalPayerId").toString(), "验证externalPayerId");
					Logger.verifyEquals(PayGateWayCallService.SFTWxOpenId, body.get("externalUserId").toString(), "验证externalPayerId");
					Logger.verifyNotNull(body.get("instPaymentId").toString(), "验证instPaymentId");
					Logger.verifyEquals(aqb.getUserId(), body.get("internalUserId").toString(), "验证internalUserId");
					Logger.verifyEquals(PayGateWayCallService.SFTMerchantNo, body.get("merchantNo").toString(), "验证merchantNo");
					//汇率换算 忽略
//					Logger.verifyEquals(aqb.getPayPrice(), body.get("orderRmb").toString(), "验证orderRmb");
					Logger.verifyEquals("ShengPay", body.get("payChannel").toString(), "验证payChannel");
					Logger.verifyEquals(new BigDecimal( aqb.getPayPrice()).setScale(2), new BigDecimal( body.get("payPrice").toString()).setScale(2), "验证payPrice");
					Logger.verifyEquals(new BigDecimal( aqb.getPayPrice()).setScale(2), new BigDecimal( body.get("orderRmb").toString()).setScale(2), "验证orderRmb");
					
					Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
					Logger.verifyEquals(sftb.getOrderNo(), body.get("paymentId").toString(), "验证paymentId");
					Logger.verifyEquals(new BigDecimal( aqb.getPayPrice()).setScale(2), new BigDecimal( body.get("settleAmount").toString()).setScale(2), "验证settleAmount");
					Logger.verifyEquals("CNY", body.get("settleCurrency").toString(), "验证settleCurrency");
					MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(
							aqb.getOrderId()).get(0);
					Logger.verifyEquals(ppm.getTradingId(), body.get("tradingId").toString(), "验证tradingId");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_157() {
		Logger.start(true, "6011盛付通微信公众号支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6011");
			AcquireOrderCall acquireorderCall = PayGateWayCallService.acquireOrder(aqb);
			List<String> clist = acquireorderCall.getReqHeader();
			SFTNotifyBean sftb = PayGateWayCallService.initSFTNotifyBean(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			String send = PayGateWayCallService.SFTPayNotifyBeanToSend(sftb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("OK", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, sftb,"");
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.debug(mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(sftb.getOrderNo(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("ShengPay", body.get("payChannel").toString(), "验证payChannel");
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_158() {
		Logger.start(true, "商户号不正确6011盛付通微信公众号支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6011");
			AcquireOrderCall acquireorderCall = PayGateWayCallService.acquireOrder(aqb);
			List<String> clist = acquireorderCall.getReqHeader();
			SFTNotifyBean sftb = PayGateWayCallService.initSFTNotifyBean(aqb);
			sftb.setMerchantNo("1");
			notifyCall = new NotifyCall(aqb.getPayType());
			String send = PayGateWayCallService.SFTPayNotifyBeanToSend(sftb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_159() {
		Logger.start(true, "金额不正确6011盛付通微信公众号支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6011");
			AcquireOrderCall acquireorderCall = PayGateWayCallService.acquireOrder(aqb);
			List<String> clist = acquireorderCall.getReqHeader();
			SFTNotifyBean sftb = PayGateWayCallService.initSFTNotifyBean(aqb);
			sftb.setTransAmount(1+aqb.getPayPrice());
			notifyCall = new NotifyCall(aqb.getPayType());
			String send = PayGateWayCallService.SFTPayNotifyBeanToSend(sftb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("failed", notifyCall.getReturnData(), "验证success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_160() {
		Logger.start(true, "返回code不正确6011盛付通微信公众号支付异步回调失败");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6011");
			AcquireOrderCall acquireorderCall = PayGateWayCallService.acquireOrder(aqb);
			List<String> clist = acquireorderCall.getReqHeader();
			SFTNotifyBean sftb = PayGateWayCallService.initSFTNotifyBean(aqb);
			sftb.setTransStatus("02");
			notifyCall = new NotifyCall(aqb.getPayType());
			String send = PayGateWayCallService.SFTPayNotifyBeanToSend(sftb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("OK", notifyCall.getReturnData(), "验证success");
			//验证数据库状态是 失败
			Thread.sleep(1000);
			MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			Logger.verifyNotEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_161() {
		Logger.start(false, "6006HipoPayAliWap支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6006");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoNotifyBean.setCurrency("CNY");//rmb
			hipoNotifyBean.setSettle_currency("HKD");
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPayAli", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_Notify_162() {
		Logger.start(true, "6100GodAliPayPc支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6100");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			alinotifyBean.setSeller_email(PayGateWayCallService.GODAliPay_EMAIL);
			alinotifyBean.setSeller_id(PayGateWayCallService.GODAliPay_MERID);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);

			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");

			verifyDB(aqb, alinotifyBean);

			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(alinotifyBean.getPrice()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(alinotifyBean.getOut_trade_no(), body.get("paymentId").toString(), "验证paymentId");
				if(PayGateWayCallService.OpenYangYi){
					Logger.verifyEquals("GodAliPay", body.get("payChannel").toString(), "验证payChannel");
				}else{
					Logger.verifyEquals("GodAliPay", body.get("payChannel").toString(), "验证payChannel");
				}
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_163() {
		Logger.start(false, "6103.HipoPay-微信app支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6103");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall("hipoPayNotify/6103");
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoNotifyBean.setCurrency("CNY");//rmb
			hipoNotifyBean.setSettle_currency("HKD");
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.comment("mock:"+mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6103")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleAmount");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleAmount");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_164() {
		Logger.start(false, "6107.HipoPay-支付宝app支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6107");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall("hipoPayNotify/6107");
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoNotifyBean.setCurrency("CNY");//rmb
			hipoNotifyBean.setSettle_currency("HKD");
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Logger.comment("mock:"+mock);
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyIsContains("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6107")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleAmount");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleAmount");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_165() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-GBP-精度问题-修改为20位汇率精度计算");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			aqb.setPayPrice("2888.00");
			aqb.setSettleCurrency("GBP");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,PayGateWayCallService.GBPExchangeRate);
			hipoNotifyBean.setCurrency("CNY");//rmb
			hipoNotifyBean.setSettle_currency("GBP");
			hipoNotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_166() {
		Logger.start(false, "6003HipoPayWxH5支付回调成功-HK");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6003");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyH5Call hipoPayNotifyCall=new HipoPayNotifyH5Call();
			HipoNotifyH5Bean hipoH5NotifyBean = initHipoH5NotifyBean(aqb,PayGateWayCallService.HKExchangeRate);
			hipoH5NotifyBean.setCurrency("CNY");//rmb
//			hipoH5NotifyBean.setSettle_currency("HKD");
			hipoH5NotifyBean.setPay_currency("CNY");
			String send = FormatUtil.beanToHttpString(hipoH5NotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoH5NotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoH5NotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoH5NotifyBean.getAgent_order_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoH5NotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoH5NotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_Notify_167() {
		Logger.start(false, "6000HipoPayWxApp支付回调成功-HK-计价币种外币");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("6000");
			aqb.setCurrency("HKD");
			PayGateWayCallService.acquireOrder(aqb);
			HipoPayNotifyCall hipoPayNotifyCall=new HipoPayNotifyCall();
			hipoNotifyBean = initHipoNotifyBean(aqb,"1");
			hipoNotifyBean.setCurrency("HKD");//rmb
			hipoNotifyBean.setSettle_currency("CNY");
			hipoNotifyBean.setPay_currency("CNY");
			String pay_amount=new BigDecimal(aqb.getPayPrice().toString()).add(BigDecimal.valueOf(1d)).setScale(2).toString();
			//设置支付的rmb金额-这个金额对应验证orderRmb
			//计价为外币的时候给交易系统通知OrderRmb 对应case120 CNY的时候给PayPrice
			hipoNotifyBean.setPay_amount(pay_amount);
			String send = FormatUtil.beanToHttpString(hipoNotifyBean, true);
			hipoPayNotifyCall.setData(send);
			hipoPayNotifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			hipoPayNotifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			hipoPayNotifyCall.callService();
			Logger.verifyEquals("success", hipoPayNotifyCall.getReturnData(), "验证success");
			verifyDB(aqb, hipoNotifyBean);
			List<Map> mocks = new PayGateWayWapper().selectMockHttpRecordByMockId(mockid);
			for (Map mock : mocks) {
				Map body = (Map) FormatUtil.GSONToObject(mock.get("Body").toString(), Map.class);
				Logger.comment("body:"+body);
//				Logger.verifyEquals(alinotifyBean.getBuyer_email(), body.get("externalUserId").toString(), "验证externalUserId");
//				Logger.verifyEquals(alinotifyBean.getBuyer_id(), body.get("externalPayerId").toString(), "验证externalPayerId");
				Logger.verifyEquals(Double.valueOf(hipoNotifyBean.getAmount()), Double.valueOf(body.get("payPrice").toString()), "验证payPrice");
				Logger.verifyEquals(hipoNotifyBean.getOut_trade_id(), body.get("paymentId").toString(), "验证paymentId");
				Logger.verifyEquals("HipoPay", body.get("payChannel").toString(), "验证payChannel");
				Logger.verifyEquals(aqb.getPayType(), body.get("payType").toString(), "验证payType");
				Logger.verifyEquals(aqb.getSettleCurrency(), body.get("settleCurrency").toString(), "验证settleCurrency");
				Logger.verifyEquals(hipoNotifyBean.getExchange_rate(), body.get("settleRate").toString(), "验证settleRate");
				if(aqb.getPayType().equals("6000")){
		            BigDecimal settleRate = new BigDecimal(hipoNotifyBean.getExchange_rate()); // HipoPay给出的结算汇率是 外币对人民币
		            BigDecimal settleAmount = BigDecimal.ONE.divide(settleRate, 20, BigDecimal.ROUND_DOWN) // 取倒数后就是 人民币对外币
		                    .multiply( new BigDecimal(aqb.getPayPrice())) // 算出外部金额
		                    .setScale(2, BigDecimal.ROUND_DOWN);        // 取两位小数 尾部截断
		            Logger.verifyEquals(settleAmount,new BigDecimal( body.get("settleAmount").toString()), "验证settleRate");
		            Logger.debug("settleAmount:"+settleAmount);
		            MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		            Logger.verifyEquals(settleAmount,ppm.getSettleAmount(), "验证dbsettleRate");
		            Logger.verifyEquals(new BigDecimal(body.get("orderRmb").toString()).setScale(2), new BigDecimal(hipoNotifyBean.getPay_amount()).setScale(2), "验证orderRmb");

		        }
				
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_168() {
		Logger.start(true, "4013.百度支付宝-APP支付异步回调成功");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4013");
			PayGateWayCallService.acquireOrder(aqb);
			notifyCall = new NotifyCall(aqb.getPayType());
			alinotifyBean = initAliPayNotifyBean(aqb);
			String send = aliPayNotifyBeanToSend(alinotifyBean, aqb);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, alinotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_Notify_169() {
		Logger.start(true, "4016.百度微信扫描支付异步回调成功,openid为空");
		try {
			AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("4016");
			PayGateWayCallService.acquireOrder(aqb);

			notifyCall = new NotifyCall(aqb.getPayType());
			wxnotifyBean = initWeixinBean(aqb);
			wxnotifyBean.setOpenid(null);
			String send = weiXinNotifyBeanToSend(wxnotifyBean);
			notifyCall.setData(send);
			notifyCall.addHeader("Mock", "1");
			String mockid = TestDataManager.getRandomUUID().toString();
			notifyCall.addHeader("MockId", mockid);
			Logger.comment("添加Mock:" + mockid);
			notifyCall.callService();
			Logger.verifyEquals("<xml><return_code>SUCCESS</return_code><return_msg>OK</return_msg></xml>", notifyCall.getReturnData(), "验证success");
			verifyDB(aqb, wxnotifyBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	private void verifyDB(AcquireOrderBean aqb, HipoNotifyBean hipoNotifyBean2) throws InterruptedException, ClientProtocolException, IOException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		
//		SettleRate	varchar(32)	Null	结算汇率（结算币种 对 人民币）- 支付回调记录（HipoPay）	0.8551234567980
		Logger.verifyEquals(hipoNotifyBean2.getExchange_rate(), ppm.getSettleRate(), "验证SettleRate");
//
//		PriceCurrency	varchar(10)	Null	计价币种 - 支付回调记录（HipoPay）	CNY
		Logger.verifyEquals(hipoNotifyBean2.getCurrency(), ppm.getPriceCurrency(), "验证PriceCurrency");
		
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(hipoNotifyBean2.getPayment_no(), ppm.getInstitutionPaymentId(), "验证Payment_no");
		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
//		Logger.verifyEquals(hipoNotifyBean2.getOpenid(), ppm.getPayerId(), "验证PayerId");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Logger.verifyEquals(pid, hipoNotifyBean2.getOut_trade_id(), "验证getOut_trade_id为PaymentId");
//		if(hipoNotifyBean2.getSettlement_total_fee()!=null){
//			//原价=
//			Logger.verifyEquals(new BigDecimal(aqb.getPayPrice()).multiply(BigDecimal.valueOf(100l)).setScale(0),ppm.getDiscountAmt().multiply(BigDecimal.valueOf(100l)).add(new BigDecimal(wxnotifbean.getSettlement_total_fee())).setScale(0),"验证优惠金额");
//		}
		if(hipoNotifyBean2.getPay_amount()!=null) {
			Logger.verifyEquals(new BigDecimal( hipoNotifyBean2.getPay_amount()).setScale(2), ppm.getOrderRmb().setScale(2), "验证Pay_amount等于OrderRmb");
		}
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		//60- 微信代购神器（订单支付充值）->60	神器-买家交易中间账户	GodTransactionAccount
		if(!aqb.getPayType().equals("6006")) {
			Logger.verifyEquals(aqb.getBizCode(),actinfo.getAccountType().toString(), "验证AccountType为60");
		}
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("60")) {
			Logger.verifyEquals("160001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:");
			Logger.verifyEquals("60", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
		if(aqb.getPayType().equals("6000")||aqb.getPayType().equals("6001")) {
			Logger.comment("hipopay验证mq");
			//		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
			MessageListBean MessageListBean = MqQueryCallService.initMiniAppPaynotify(hipoNotifyBean.getOut_trade_id());
			List<Map> mqmsg = MqQueryCallService.GetMqMessage(MessageListBean);
			Logger.verifyEquals(true, mqmsg.size() == 1, "验证总线消息");
			if(mqmsg.size()>0) {
				Logger.verifyEquals(ppm.getPayerId(), mqmsg.get(0).get("openId"), "验证openid");
				Logger.verifyEquals(ppm.getInstProxyPaymentId(), mqmsg.get(0).get("prePayId"), "验证prePayId");
				Logger.verifyEquals(ppm.getTradingId(), mqmsg.get(0).get("tradingId"), "验证tradingId");
				Logger.verifyEquals(ppm.getUserId(), mqmsg.get(0).get("userId"), "验证userId");
				Logger.verifyEquals(YMTDateUtil.getFormatTime(ppm.getPayTime(), "yyyy-MM-dd HH:mm:ss"), mqmsg.get(0).get("payTime"), "验证PayTime");
			}
		}
	}
	private void verifyDB(AcquireOrderBean aqb, HipoNotifyH5Bean hipoNotifyBean2) throws InterruptedException, ClientProtocolException, IOException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		
//		SettleRate	varchar(32)	Null	结算汇率（结算币种 对 人民币）- 支付回调记录（HipoPay）	0.8551234567980
		Logger.verifyEquals(hipoNotifyBean2.getExchange_rate(), ppm.getSettleRate(), "验证SettleRate");
//
//		PriceCurrency	varchar(10)	Null	计价币种 - 支付回调记录（HipoPay）	CNY
		Logger.verifyEquals(hipoNotifyBean2.getCurrency(), ppm.getPriceCurrency(), "验证PriceCurrency");
		
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(hipoNotifyBean2.getNo(), ppm.getInstitutionPaymentId(), "验证Payment_no");
		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
//		Logger.verifyEquals(hipoNotifyBean2.getOpenid(), ppm.getPayerId(), "验证PayerId");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Logger.verifyEquals(pid, hipoNotifyBean2.getAgent_order_id(), "验证getOut_trade_id为PaymentId");
//		if(hipoNotifyBean2.getSettlement_total_fee()!=null){
//			//原价=
//			Logger.verifyEquals(new BigDecimal(aqb.getPayPrice()).multiply(BigDecimal.valueOf(100l)).setScale(0),ppm.getDiscountAmt().multiply(BigDecimal.valueOf(100l)).add(new BigDecimal(wxnotifbean.getSettlement_total_fee())).setScale(0),"验证优惠金额");
//		}
		if(hipoNotifyBean2.getPay_amount()!=null) {
			Logger.verifyEquals(new BigDecimal( hipoNotifyBean2.getPay_amount()).setScale(2), ppm.getOrderRmb().setScale(2), "验证Pay_amount等于OrderRmb");
		}
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		//60- 微信代购神器（订单支付充值）->60	神器-买家交易中间账户	GodTransactionAccount
		Logger.verifyEquals(60,actinfo.getAccountType(), "验证AccountType为60");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("60")) {
			Logger.verifyEquals("160001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:");
			Logger.verifyEquals("60", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
		//hipopay h5 openid 记下来无用 所以不发送 20190605
//		Logger.comment("hipopay验证mq");
//		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
//		MessageListBean MessageListBean = MqQueryCallService.initMiniAppPaynotify(hipoNotifyBean2.getAgent_order_id());
//		List<Map> mqmsg = MqQueryCallService.GetMqMessage(MessageListBean);
//		Logger.verifyEquals(true, mqmsg.size() == 1, "验证总线消息");
//		if(mqmsg.size()>0) {
//			Logger.verifyEquals(ppm.getPayerId(), mqmsg.get(0).get("openId"), "验证openid");
//			Logger.verifyEquals(ppm.getInstProxyPaymentId(), mqmsg.get(0).get("prePayId"), "验证prePayId");
//			Logger.verifyEquals(ppm.getTradingId(), mqmsg.get(0).get("tradingId"), "验证tradingId");
//			Logger.verifyEquals(ppm.getUserId(), mqmsg.get(0).get("userId"), "验证userId");
//			Logger.verifyEquals(YMTDateUtil.getFormatTime(ppm.getPayTime(), "yyyy-MM-dd HH:mm:ss"), mqmsg.get(0).get("payTime"), "验证PayTime");
//		}
	}
	private void verifyDB(AcquireOrderBean aqb, ApplePayNotifyBean applyPayNotifyBean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.debug("PPPayment:" + FormatUtil.beanToGSONString(ppm));
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("156", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(applyPayNotifyBean.getQueryId(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");

		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}else if (aqb.getBizCode().equals("6")) {
			Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:预售定金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
	}

	private void verifyDB(AcquireOrderBean aqb, BaoFuNotifyBean baofunbean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.debug("PPPayment:" + FormatUtil.beanToGSONString(ppm));
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		// 宝付修改了协议orderid记得是宝付流水 getVoucher_no是第三方流水支付宝
		Logger.verifyEquals(baofunbean.getOrder_id(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		// Logger.verifyEquals(baofunbean.getVoucher_no(), ppm.getBankId(),
		// "验证BankId-第三方流水支付宝");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}else if (aqb.getBizCode().equals("6")) {
			Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:预售定金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	private void verifyDB(AcquireOrderBean aqb, CMBNotifyBean cmbnotifybean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(cmbnotifybean.getNoticeData().getBankSerialNo(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");

		Logger.verifyEquals(new BigDecimal(cmbnotifybean.getNoticeData().getDiscountAmount()).setScale(2), ppm.getDiscountAmt().setScale(2), "验证DiscountAmt");
		Double app = Double.valueOf(aqb.getPayPrice()) - Double.valueOf(cmbNotifyBean.getNoticeData().getDiscountAmount());
		// Logger.verifyEquals(app,
		// Double.valueOf(ppm.getActualPayPrice().toString()),
		// "验证ActualPayPrice");

		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	// @Test
	// @Category(P2.class)
	// @TestCase
	// @i
	// public void Tc_Notify_052() {
	// Logger.start(true, "使用交易服务生成的订单数据调用13.支付宝-APP支付异步回调成功");
	// try {
	// AcquireOrderBean aqb = PayGateWayCallService.initAcquireOrder("13");
	// aqb.setOrderId("8629202");
	// aqb.setPayPrice("265");
	// aqb.setUserId("20238699");
	// aqb.setProductName("接口自动化测试Test");
	// notifyCall = new NotifyCall(aqb.getPayType());
	// alinotifyBean = initAliPayNotifyBean(aqb);
	// String send = aliPayNotifyBeanToSend(alinotifyBean);
	// notifyCall.setData(send);
	// notifyCall.addHeader("Mock", "1");
	// String mockid = TestDataManager.getRandomUUID().toString();
	// notifyCall.addHeader("MockId", mockid);
	// Logger.comment("添加Mock:" + mockid);
	// notifyCall.callService();
	// Logger.verifyEquals("success", notifyCall.getReturnData(), "验证success");
	// } catch (Exception e) {
	// Logger.fail(e);
	// }
	// }
	/**
	 * 用于验证翼支付
	 * 
	 * @param aqb
	 * @param bestPayNotifyBean
	 * @throws InterruptedException
	 */
	private void verifyDB(AcquireOrderBean aqb, BestPayNotifyBean bestPayNotifyBean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(bestPayNotifyBean.getUPTRANSEQ(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Logger.verifyEquals(pid, bestPayNotifyBean.getORDERSEQ(), "验证PaymentId");
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("缴纳服务保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:缴纳服务保证金（支付宝付款）");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

	}

	/**
	 * db验证 用于阿里支付
	 * 
	 * @param aqb
	 * @param alinotifyBean1
	 * @throws InterruptedException
	 */
	private void verifyDB(AcquireOrderBean aqb, AliPayNotifyBean alinotifyBean1) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}
		// Out_channel_type()==null时不处理 可能是WAIT_BUYER_PAY
		if ((aqb.getPayType().equals("8") || aqb.getPayType().equals("9") || aqb.getPayType().equals("1009")) && alinotifyBean1.getOut_channel_type() == null) {
			Logger.verifyEquals(aqb.getPayType(), ppm.getPayType().toString(), "验证PPPayment的PayType");
		}
		// 判断是否是真正的花呗分期PCREDIT_CC_PCREDIT_INSTALLMENT,不是的话修改type
		else if ((aqb.getPayType().equals("9") || aqb.getPayType().equals("1009")) && (!"PCREDIT_CC_PCREDIT_INSTALLMENT".equals(alinotifyBean1.getOut_channel_type()))) {
			if (PayGateWayCallService.OpenYangYi) {
				Logger.verifyEquals("1013", ppm.getPayType().toString(), "验证PPPayment的PayType");
			} else {
				Logger.verifyEquals("13", ppm.getPayType().toString(), "验证PPPayment的PayType");
			}
		} 
		else if ((aqb.getPayType().equals("8")) && (!"PCREDIT_PAY".equals(alinotifyBean1.getOut_channel_type()))) {
			if (PayGateWayCallService.OpenYangYi) {
				Logger.verifyEquals("1013", ppm.getPayType().toString(), "验证PPPayment的PayType");
			} else {
				Logger.verifyEquals("13", ppm.getPayType().toString(), "验证PPPayment的PayType");
			}
		} 
		else {
			Logger.verifyEquals(aqb.getPayType(), ppm.getPayType().toString(), "验证PPPayment的PayType");
		}

		// 支付成功才验证支付状态和资金流水
		if (alinotifyBean1.getTrade_status().equals("TRADE_SUCCESS")) {
			Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
			// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
			// "验证ActualPayCurrencyType");
			Logger.verifyEquals(alinotifyBean1.getTrade_no(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
			// ?getExchangeRate待确认
			// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
			Logger.verifyEquals(alinotifyBean1.getBuyer_id(), ppm.getPayerId(), "验证PayerId");
			Logger.verifyEquals(alinotifyBean1.getBuyer_email(), ppm.getPayerEmail(), "验证PayerEmail");
			Logger.comment("验证AccountEntry");
			String pid = ppm.getPaymentId();
			Logger.debug("PaymentId:" + pid);
			Map m = new HashMap();
			m.put("bizno", pid);
			AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
			Logger.debug(FormatUtil.beanToGSONString(actinfo));
			Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
			Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
			// 入账 type 2
			Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
			Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
			Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
			Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
			if (aqb.getBizCode().equals("1")) {
				Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:卖家保证金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("2")) {
				Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:卖家保证金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("3")) {
				Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:卖家保证金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("4")) {
				Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("缴纳服务保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:缴纳服务保证金（支付宝付款）");
				Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("15")) {
				Logger.verifyEquals("101503", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("缴纳拼邮溯源保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:缴纳拼邮溯源保证金（支付宝付款）");
				Logger.verifyEquals("15", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("17")) {
				Logger.verifyEquals("101703", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("全球买手专项保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:全球买手专项保证金（支付宝付款）");
				Logger.verifyEquals("17", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			} else if (aqb.getBizCode().equals("16")) {
				Logger.verifyEquals("101603", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("黑五专项保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:黑五专项保证金（支付宝付款）");
				Logger.verifyEquals("16", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
			else if (aqb.getBizCode().equals("6")) {
				Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:预售定金充值");
				Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
			else if (aqb.getBizCode().equals("19")) {
				Logger.verifyEquals("101903", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("直播保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:直播保证金（支付宝付款）");
				Logger.verifyEquals("19", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
			else if (aqb.getBizCode().equals("20")) {
				Logger.verifyEquals("102003", actinfo.getBizCode().toString(), "验证Bizcode");
				Logger.verifyEquals("高客单价保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
				Logger.comment("验证AccountInfo:高客单价保证金（支付宝付款）");
				Logger.verifyEquals("20", nactinfo.getAccountType().toString(), "验证iAccountType");
				Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
			}
		} else if (alinotifyBean1.getTrade_status().equals("WAIT_BUYER_PAY")) {
			Logger.verifyEquals(PayOrderEnum.Init.getValue(), ppm.getPayStatus(), "WAIT_BUYER_PAY时验证PayStatus为Init");
			// Logger.verifyEquals(null, ppm.getActualPayCurrencyType(),
			// "验证ActualPayCurrencyType");
			Logger.verifyEquals(null, ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
			// ?getExchangeRate待确认
			// Logger.verifyEquals(null, ppm.getExchangeRate(),
			// "验证ExchangeRate");
			Logger.verifyEquals(null, ppm.getPayerId(), "验证PayerId");
			Logger.verifyEquals(null, ppm.getPayerEmail(), "验证PayerEmail");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}

	/**
	 * db验证 用于阿里支付
	 * 
	 * @param aqb
	 * @param alinotifyBean1
	 * @throws InterruptedException
	 */
	private void verifyWapDB(AcquireOrderBean aqb, AliPayWapNotifyBean awb) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		if (ppm.getInstitutionPaymentId() == null) {
			Thread.sleep(5000);
			ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		}

		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(awb.getTrade_no(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.verifyEquals(awb.getBuyer_id(), ppm.getPayerId(), "验证PayerId");
		Logger.verifyEquals(awb.getBuyer_email(), ppm.getPayerEmail(), "验证PayerEmail");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("卖家保证金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}else if (aqb.getBizCode().equals("6")) {
			Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:预售定金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");
	}
	private void verifyDB(AcquireOrderBean aqb, SFTNotifyBean SFTNotifyBean,String PayerId) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(SFTNotifyBean.getTransNo(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		Logger.verifyEquals(0, ppm.getOrderRmb().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
//		Logger.verifyEquals(PayerId, ppm.getPayerId(), "验证PayerId");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Logger.verifyEquals(pid, SFTNotifyBean.getOrderNo(), "验证OrderNo为PaymentId");
		
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		if (aqb.getBizCode().equals("33")&&aqb.getPayType().equals("3017")) {
			Logger.verifyEquals(30,actinfo.getAccountType(), "验证AccountType为30");
		};
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("缴纳服务保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:缴纳服务保证金（支付宝付款）");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}else if (aqb.getBizCode().equals("33")) {
			Logger.verifyEquals("130001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.verifyEquals(30, actinfo.getAccountType(), "验证accountType");
		}
		else if (aqb.getBizCode().equals("6")) {
			Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:预售定金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}

	}
	/**
	 * db验证 用于微信支付
	 * 
	 * @param aqb
	 * @param alinotifyBean1
	 * @throws InterruptedException
	 */
	private void verifyDB(AcquireOrderBean aqb, WeiXinNotifyBean wxnotifbean) throws InterruptedException {
		Logger.comment("验证pp_payment");
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		Logger.verifyEquals(PayOrderEnum.Success.getValue(), ppm.getPayStatus(), "验证PayStatus");
		// Logger.verifyEquals("CNY", ppm.getActualPayCurrencyType(),
		// "验证ActualPayCurrencyType");
		Logger.verifyEquals(wxnotifbean.getTransaction_id(), ppm.getInstitutionPaymentId(), "验证InstitutionPaymentId");
		// ?getExchangeRate待确认
		// Logger.verifyEquals(1d, ppm.getExchangeRate(), "验证ExchangeRate");
		Logger.verifyEquals(wxnotifbean.getOpenid(), ppm.getPayerId(), "验证PayerId");
		Logger.comment("验证AccountEntry");
		String pid = ppm.getPaymentId();
		Logger.verifyEquals(pid, wxnotifbean.getOut_trade_no(), "验证weixinbean.Out_trade_no为PaymentId");
		if(wxnotifbean.getSettlement_total_fee()!=null){
			//原价=
			Logger.verifyEquals(new BigDecimal(aqb.getPayPrice()).multiply(BigDecimal.valueOf(100l)).setScale(0),ppm.getDiscountAmt().multiply(BigDecimal.valueOf(100l)).add(new BigDecimal(wxnotifbean.getSettlement_total_fee())).setScale(0),"验证优惠金额");
		}
		Map m = new HashMap();
		m.put("bizno", pid);
		AccountEntry actinfo = new AccountWapper().selectAccountEntryByBizNo(m).get(0);
		Logger.debug(FormatUtil.beanToGSONString(actinfo));
		Logger.verifyEquals(aqb.getUserId(), actinfo.getUserId().toString(), "验证Userid");
		Logger.verifyEquals(0, actinfo.getAmount().compareTo(new BigDecimal(aqb.getPayPrice())), "验证PayPrice:" + aqb.getPayPrice());
		// 入账 type 2
		Logger.verifyEquals("2", actinfo.getEntryType().toString(), "验证Entrytype");
		Logger.verifyEquals(pid, actinfo.getBizNo(), "验证Bizno为PaymentId");
		Logger.verifyEquals(aqb.getOrderId(), actinfo.getOriginalNo(), "验证Originalno为orderid");
		if (aqb.getBizCode().equals("33")&&aqb.getPayType().equals("3017")) {
			Logger.verifyEquals(30,actinfo.getAccountType(), "验证AccountType为30");
		};
		Account nactinfo = new AccountWapper().selectAccountInfo(actinfo.getAccountId()).get(0);
		if (aqb.getBizCode().equals("1")) {
			Logger.verifyEquals("100002", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("补款充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("2")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("现金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("3")) {
			Logger.verifyEquals("100001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:卖家保证金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		} else if (aqb.getBizCode().equals("4")) {
			Logger.verifyEquals("100003", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("缴纳服务保证金（支付宝付款）", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:缴纳服务保证金（支付宝付款）");
			Logger.verifyEquals("11", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1001", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}else if (aqb.getBizCode().equals("33")) {
			Logger.verifyEquals("130001", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("定金充值", actinfo.getMemo(), "验证Memo");
			Logger.verifyEquals(30, actinfo.getAccountType(), "验证accountType");
		}
		else if (aqb.getBizCode().equals("6")) {
			Logger.verifyEquals("100007", actinfo.getBizCode().toString(), "验证Bizcode");
			Logger.verifyEquals("预售定金充值", actinfo.getMemo(), "验证Memo");
			Logger.comment("验证AccountInfo:预售定金充值");
			Logger.verifyEquals("1", nactinfo.getAccountType().toString(), "验证iAccountType");
			Logger.verifyEquals("1", nactinfo.getCurrencyType().toString(), "验证iCurrencyType");
		}
		// Logger.comment("验证PP_CompensateProcessInfo（发货补偿信息）");
		// PPCompensateProcessInfo ppCompensateProcessInfo = new
		// PayGateWayWapper()
		// .selectPPCompensateProcessInfoByCorrelateId(pid).get(0);
		// Logger.verifyEquals("1", ppCompensateProcessInfo.getAppId(),
		// "验证PP_CompensateProcessInfo表中AppId字段为1");
		// Logger.verifyEquals("DeliveryNotify",
		// ppCompensateProcessInfo.getMethodName(),
		// "验证PP_CompensateProcessInfo表中MethodName字段为DeliveryNotify");
		// Logger.verifyEquals(null,
		// ppCompensateProcessInfo.getCompensateType(),
		// "验证PP_CompensateProcessInfo表中CompensateType字段为NULL:支付");

	}

	/**
	 * AliPayNotifyBean加签并转换为SendString
	 * 
	 * @param alipaybean
	 * @param aqb
	 * @return
	 * @throws Exception
	 */
	private String aliPayNotifyBeanToSend(AliPayNotifyBean alipaybean, AcquireOrderBean aqb) throws Exception {
		Logger.comment("AliPayNotifyBean加签并转换为SendString");
		String send = null;
		if (aqb.getPayType().equals("13") || aqb.getPayType().equals("1013")|| aqb.getPayType().equals("3013")|| aqb.getPayType().equals("3113")|| aqb.getPayType().equals("3213") || aqb.getPayType().equals("2013")|| aqb.getPayType().equals("4013")) {
			// 排序加签名
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			Logger.debug("src:"+src);
			String sign = new Sign().SignSHA1WithRSA(src);
			alinotifyBean.setSign(sign);
			alinotifyBean.setSign_type("RSA");
			// 转换成最终发出的数据
			send = FormatUtil.beanToHttpString(alinotifyBean, true);
		} else {
			String src = FormatUtil.beanToHttpString(alinotifyBean, false);
			String sign = new Sign().signMd5(alinotifyBean, Sign.autoTestKey);
			alinotifyBean.setSign(sign);
			alinotifyBean.setSign_type("MD5");
			send = FormatUtil.beanToHttpString(alinotifyBean, true);
		}
		return send;
	}

	private String aliPayNotifyBeanToSendPCRSA(AliPayNotifyBean alipaybean) throws Exception {
		Logger.comment("AliPayNotifyBean加签并转换为SendString");
		String send = null;
		// 排序加签名
		String src = FormatUtil.beanToHttpString(alinotifyBean, false);
		String sign = new Sign().SignSHA1WithRSA(src);
		alinotifyBean.setSign(sign);
		alinotifyBean.setSign_type("RSA");
		// 转换成最终发出的数据
		send = FormatUtil.beanToHttpString(alinotifyBean, true);
		return send;
	}

	private String aliPayNotifyBeanToSendWAPRSA(AliPayNotifyBean alipaybean) throws Exception {
		Logger.comment("AliPayNotifyBean加签并转换为SendString");
		String send = null;
		// 排序加签名
		String src = FormatUtil.beanToHttpString(alinotifyBean, false);
		String sign = new Sign().SignSHA1WithRSA(src);
		alinotifyBean.setSign(sign);
		alinotifyBean.setSign_type("RSA");
		// 转换成最终发出的数据
		send = FormatUtil.beanToHttpString(alinotifyBean, true);
		return send;
	}

	/**
	 * AliPayNotifyBean加签并转换为SendString
	 * 
	 * @param alipaybean
	 * @param aqb
	 * @return
	 * @throws Exception
	 */
	private String applyPayNotifyBeanToSend(ApplePayNotifyBean applyPayNotifyBean, AcquireOrderBean aqb) throws Exception {
		Logger.comment("ApplePayNotifyBean加签并转换为SendString");
		String plaintext = FormatUtil.beanToHttpString(applyPayNotifyBean, false);
		byte[] signDigest = SecurityUtil.sha1(plaintext, ApplePayConstants.encoding);
		signDigest = Hex.toHexBytes(signDigest, ApplePayConstants.encoding);
		PrivateKey privateKey = RSAUtils.loadPrivateKey(EnvSetup.getData("privateK"));
		byte[] signData = SecurityUtil.signWithSha1Rsa(privateKey, signDigest);
		signData = Base64.getEncoder().encode(signData);
		applyPayNotifyBean.setSignature(new String(signData));
		String send = FormatUtil.beanToHttpString(applyPayNotifyBean, true);
		return send;
	}

	/**
	 * WeiXinNotifyBean加签并转换为SendString
	 * 
	 * @param weixinbean
	 * @return
	 * @throws Exception
	 */
	public static String weiXinNotifyBeanToSend(WeiXinNotifyBean weixinbean) throws Exception {
		Logger.comment("WeiXinNotifyBean加签并转换为SendString");
		// 排序加签名
		// String src = FormatUtil.beanToHttpString(weixinbean, false);
		// String sign = SignSHA1WithRSA(src);

		String sign = new Sign().signMd5(weixinbean, "&key=" + Sign.autoTestKey);
		weixinbean.setSign(sign);

		// 转换成最终发出的数据
		String send = FormatUtil.beanToXmlString(weixinbean);
		return send;
	}

	/**
	 * 初始化 AliPayNotifyBean
	 * 
	 * @param aqb
	 * @return
	 * @throws InterruptedException
	 */
	private ApplePayNotifyBean initApplePayNotifyBean(AcquireOrderBean aqb) throws InterruptedException {
		// trandno 是PaymentId
		// PPBussinessorder ppb = new
		// PayGateWayWapper().selectPPBussinessorderByTraceId(aqb.getTraceId()).get(0);
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		Integer price = new BigDecimal(aqb.getPayPrice()).multiply(new BigDecimal(100)).intValue();

		applyPayNotifyBean.setBizType("000201");// 000201
		applyPayNotifyBean.setOrderId(trandno);// 17050410190438490

		applyPayNotifyBean.setTraceNo(TestDataManager.getRandomUUID().toString().replaceAll("-", ""));// 78591936

		applyPayNotifyBean.setSettleAmt(price);// 101

		applyPayNotifyBean.setSettleCurrencyCode("156");// 156
		applyPayNotifyBean.setTxnType("01");// 01+

		applyPayNotifyBean.setQueryId(TestDataManager.getRandomUUID().toString().replaceAll("-", ""));// 78591936

		applyPayNotifyBean.setAccessType("0");// 0
		applyPayNotifyBean.setTxnTime(YMTDateUtil.getSysTime("yyyyMMddHHmmss"));// 20170504101911
		applyPayNotifyBean.setPayCardType("01");// 01
		applyPayNotifyBean.setTxnSubType("01");// 01
		applyPayNotifyBean.setEncoding("UTF-8");// UTF-8
		applyPayNotifyBean.setVersion("5.0.0");// 5.0.0
		applyPayNotifyBean.setRespMsg("paysuccess");// paysuccess
		applyPayNotifyBean.setMerId(PayGateWayCallService.APPLEPAY_MERID);// 308310053994237
		applyPayNotifyBean.setCurrencyCode("156");// 156
		applyPayNotifyBean.setRespCode("00");// 00
		applyPayNotifyBean.setSignMethod("01");// 01

		applyPayNotifyBean.setTxnAmt(price);// 101
		return applyPayNotifyBean;
	}

	/**
	 * 初始化 AliPayNotifyBean
	 * 
	 * @param aqb
	 * @return
	 * @throws InterruptedException
	 */
	private AliPayNotifyBean initAliPayNotifyBean(AcquireOrderBean aqb) throws InterruptedException {
		alinotifyBean.setBody("自动化测试订单");
		alinotifyBean.setBusiness_scene("qrpay");
		alinotifyBean.setBuyer_email(TestDataManager.getEmail());
		alinotifyBean.setBuyer_id("2088" + TestDataManager.getRandomNum(10));
		alinotifyBean.setDiscount("0");
		alinotifyBean.setExtra_common_param("自动化测试回传参数");
		alinotifyBean.setGmt_close(YMTDateUtil.getBeforeOrNextDay(1));
		alinotifyBean.setGmt_create(YMTDateUtil.getBeforeOrNextSecond(1));
		alinotifyBean.setGmt_payment(YMTDateUtil.getBeforeOrNextSecond(2));
		alinotifyBean.setGmt_refund(null);
		alinotifyBean.setIs_total_fee_adjust("N");
		alinotifyBean.setNotify_id(TestDataManager.getClientpaymentId());
		alinotifyBean.setNotify_time(YMTDateUtil.getBeforeOrNextSecond(3));
		alinotifyBean.setNotify_type("trade_status_sync");
		// trandno 是PaymentId
		// PPBussinessorder ppb = new
		// PayGateWayWapper().selectPPBussinessorderByTraceId(aqb.getTraceId()).get(0);
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		alinotifyBean.setOut_trade_no(trandno);
		alinotifyBean.setPayment_type("1");
		alinotifyBean.setPrice(aqb.getPayPrice());
		alinotifyBean.setQuantity("1");
		alinotifyBean.setRefund_status(null);
		alinotifyBean.setSeller_email(PayGateWayCallService.Alipay_EMAIL);
		alinotifyBean.setSeller_id(PayGateWayCallService.Alipay_MERID);
		if(aqb.getPayType().equals("3113")) {
			alinotifyBean.setSeller_email(PayGateWayCallService.Alipay_EMAIL_Could);
			alinotifyBean.setSeller_id(PayGateWayCallService.Alipay_MERID_Could);
		}
		if(aqb.getPayType().equals("3213")) {
			alinotifyBean.setSeller_email(PayGateWayCallService.Alipay_EMAIL_Could);
			alinotifyBean.setSeller_id(PayGateWayCallService.Alipay_MERID_Could);
		}
		if(aqb.getPayType().equals("2013")) {
			alinotifyBean.setSeller_email(PayGateWayCallService.TouTiao_EMAIL);
			alinotifyBean.setSeller_id(PayGateWayCallService.Alipay_LOGIN_MERID);
		}
		alinotifyBean.setSubject(aqb.getProductName());
		alinotifyBean.setTotal_fee(aqb.getPayPrice());
		alinotifyBean.setTrade_no(TestDataManager.getRandomUUID().toString());
		alinotifyBean.setTrade_status("TRADE_SUCCESS");
		alinotifyBean.setUse_coupon("N");
		return alinotifyBean;
	}

	private BestPayNotifyBean initBestPayNotifyBean(AcquireOrderBean aqb) throws InterruptedException {
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		BestPayNotifyBean bestbay = new BestPayNotifyBean();
		bestbay.setATTACH(null);
		bestbay.setATTACHAMOUNT("0");
		// 默认翼支付卡
		bestbay.setBANKID("BESTCARD");
		bestbay.setENCODETYPE("1");
		bestbay.setMERCHANTID(PayGateWayCallService.BESTPAY_MERID);
		bestbay.setORDERAMOUNT(aqb.getPayPrice());
		// TODO 格式 yyyyMMDDhhmmss+（不小于 4 位）流水号。与订单号填一致??目前传订单号
		bestbay.setORDERREQTRANSEQ(trandno);
		bestbay.setORDERSEQ(trandno);
		bestbay.setPRODUCTAMOUNT(aqb.getPayPrice());
		bestbay.setPRODUCTNO(null);
		bestbay.setRETNCODE("0000");
		bestbay.setRETNINFO("0000");
		// 签名需要加密 后续运算
		bestbay.setSIGN(null);
		bestbay.setTRANDATE(YMTDateUtil.getBeforeOrNextDay(0, "yyyyMMdd"));
		bestbay.setUPBANKTRANSEQ(null);
		bestbay.setUPREQTRANSEQ(trandno);
		bestbay.setUPTRANSEQ(TestDataManager.getClientpaymentId());
		bestbay.setURTYPE("RMB");
		return bestbay;
	}

	private String bestNotifyBeanToSend(BestPayNotifyBean bestPayNotifyBean) {
		StringBuffer soucreString = new StringBuffer();
		// UPTRANSEQ=20080101000001&MERCHANTID=0250000001&ORDERSEQ=2006050112564931556&
		// ORDERAMOUNT=10000&RETNCODE=0000&RETNINFO=0000&TRANDATE=20060101&KEY=3
		// 44C4FB521F5A52EA28FB7FC79AEA889478D4343E4548C02

		soucreString.append("UPTRANSEQ=");
		soucreString.append(bestPayNotifyBean.getUPTRANSEQ());
		soucreString.append("&MERCHANTID=");
		soucreString.append(bestPayNotifyBean.getMERCHANTID());
		soucreString.append("&ORDERSEQ=");
		soucreString.append(bestPayNotifyBean.getORDERSEQ());
		soucreString.append("&ORDERAMOUNT=");
		soucreString.append(bestPayNotifyBean.getORDERAMOUNT());
		soucreString.append("&RETNCODE=");
		soucreString.append(bestPayNotifyBean.getRETNCODE());
		soucreString.append("&RETNINFO=");
		soucreString.append(bestPayNotifyBean.getRETNINFO());
		soucreString.append("&TRANDATE=");
		soucreString.append(bestPayNotifyBean.getTRANDATE());
		soucreString.append("&KEY=");
		soucreString.append(PayGateWayCallService.autoTestKey);
		Logger.debug("source:" + soucreString);
		String SIGN = TestDataManager.getMD5(soucreString.toString().getBytes());
		bestPayNotifyBean.setSIGN(SIGN.toUpperCase());
		String formatString = FormatUtil.beanToHttpString(bestPayNotifyBean, true);
		Logger.debug("fmt:" + formatString);
		return formatString;
	}

	/**
	 * 初始化 AliPayNotifyBean
	 * 
	 * @param aqb
	 * @return
	 * @throws Exception
	 */
	private WeiXinNotifyBean initWeixinBean(AcquireOrderBean aqb) throws Exception {
		// <xml><appid><![CDATA[wxf51a439c0416f182]]></appid>
		// <bank_type><![CDATA[CMB_DEBIT]]></bank_type>
		// <cash_fee><![CDATA[8200]]></cash_fee>
		// <fee_type><![CDATA[CNY]]></fee_type>
		// <is_subscribe><![CDATA[N]]></is_subscribe>
		// <mch_id><![CDATA[1234079001]]></mch_id>
		// <nonce_str><![CDATA[b82bbe0b28954973ad2a9c98618af516]]></nonce_str>
		// <openid><![CDATA[oASzYjrBI-LG8JMNSIC3c5VSynGU]]></openid>
		// <out_trade_no><![CDATA[20160412172258588000000000023844]]></out_trade_no>
		// <result_code><![CDATA[SUCCESS]]></result_code>
		// <return_code><![CDATA[SUCCESS]]></return_code>
		// <sign><![CDATA[E39042D497F3952F55F17D310B58EC36]]></sign>
		// <time_end><![CDATA[20160412172307]]></time_end>
		// <total_fee>8200</total_fee>
		// <trade_type><![CDATA[APP]]></trade_type>
		// <transaction_id><![CDATA[4009562001201604124771601467]]></transaction_id>
		// </xml>
		wxnotifyBean.setAppid(PayGateWayCallService.WX_DefAppID);
		String paytype=aqb.getPayType();
		if(paytype.length()==4&&(!paytype.equals("3117")&&!paytype.equals("3115")&&!paytype.equals("3215")&&!paytype.equals("3017")&&(!paytype.equals("3015")))){
			paytype=paytype.substring(2);
		}
		if (paytype.equals("17")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_AppID);
		}
		if (paytype.equals("18")) {
			wxnotifyBean.setAppid(PayGateWayCallService.LiveShop_AppId);
		}
		if (paytype.equals("19")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_HS_AppID);
		}
		if (paytype.equals("3017")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_QQG_AppID);
		}
		if (paytype.equals("3015")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_QQG_AppID2);
		}
		if (paytype.equals("3117")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_QQG_AppID_Could_17);
		}
		if (paytype.equals("3115")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_QQG_AppID_Could_15);
		}
		if (paytype.equals("3215")) {
			wxnotifyBean.setAppid(PayGateWayCallService.WX_QQG_AppID_Could_15_YDD);
		}
		wxnotifyBean.setAttach(TestDataManager.getRandomUUID().toString());
		wxnotifyBean.setBank_type(BankIdEnum.CMB.name());
		Double payprice = Double.valueOf(aqb.getPayPrice());
		int iprice = (int) (payprice * 100);
		Logger.debug("iprice:" + iprice);
		wxnotifyBean.setCash_fee(String.valueOf(iprice));
		wxnotifyBean.setCash_fee_type(null);
		wxnotifyBean.setCoupon_count("0");
		wxnotifyBean.setCoupon_fee("0");
		wxnotifyBean.setDevice_info(TestDataManager.getRandomUUID().toString());
		wxnotifyBean.setErr_code(null);
		wxnotifyBean.setErr_code_des(null);
		wxnotifyBean.setFee_type("CNY");
		wxnotifyBean.setIs_subscribe("N");
		if (paytype.equals("14") || paytype.equals("16") || paytype.equals("17")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_Wap_merchantId);
		} else if (paytype.equals("18")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.LiveShop_merchantId);
		} else if (paytype.equals("19")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_HS_merchantId);
		} else if (paytype.equals("15")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_App_merchantId);
		} else if (paytype.equals("3017")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_QQG_merchantId);
		}else if (paytype.equals("3015")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_QQG_merchantId2);
		}else if (paytype.equals("3117")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_QQG_merchantId_Could);
		}else if (paytype.equals("3115")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_QQG_merchantId_Could);
		}else if (paytype.equals("3215")) {
			wxnotifyBean.setMch_id(PayGateWayCallService.WX_QQG_merchantId_Could);
		}else {
			throw new Exception("not found merchantId");
		}
		wxnotifyBean.setNonce_str(TestDataManager.getRandomUUID().toString().replace("-", "").substring(0, 31));
		// Map m = new DefaultWapper().selectLastWeixinUser();
		ThirdpartyUserbind tu = new JUserWapper().selectWXUser();
		String uid = tu.getUserId().toString();
		wxnotifyBean.setOpenid(tu.getOpenId());
		// trandno 是PaymentId
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		wxnotifyBean.setOut_trade_no(trandno);
		wxnotifyBean.setResult_code("SUCCESS");
		wxnotifyBean.setTime_end(YMTDateUtil.getSysTime("yyyyMMddHHmmss"));
		wxnotifyBean.setTotal_fee(String.valueOf(iprice));
		if (paytype.equals("14")) {
			wxnotifyBean.setTrade_type("JSAPI");
		} else if (paytype.equals("15")) {
			wxnotifyBean.setTrade_type("APP");
		} else {
			wxnotifyBean.setTrade_type("NATIVE");
		}
		wxnotifyBean.setTransaction_id(TestDataManager.getRandomUUID().toString().replace("-", "").substring(0, 31));
		wxnotifyBean.setReturn_code("SUCCESS");
		wxnotifyBean.setReturn_msg("成功");
		return wxnotifyBean;
	}
	/**
	 * @param aqb
	 * @param exchange_rate 汇率
	 * @return
	 * @throws InterruptedException 
	 */
	private HipoNotifyBean initHipoNotifyBean(AcquireOrderBean aqb,String exchange_rate) throws InterruptedException {
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		hipoNotifyBean.setAmount(aqb.getPayPrice());
		//结算？
		hipoNotifyBean.setCurrency("CNY");
		hipoNotifyBean.setExchange_rate(exchange_rate);
		hipoNotifyBean.setFinish_time(YMTDateUtil.getBeforeOrNextSecond(-1, "yyyy-MM-dd HH:mm:ss"));
		hipoNotifyBean.setOut_trade_id(trandno);
		hipoNotifyBean.setPay_amount(aqb.getPayPrice());
		hipoNotifyBean.setPay_currency("CNY");
		hipoNotifyBean.setPayment_no(TestDataManager.getRandomUUID().toString().replace("-", "").substring(0, 31));
		hipoNotifyBean.setStatus("PAID");
		hipoNotifyBean.setTrade_time(YMTDateUtil.getBeforeOrNextSecond(-10, "yyyy-MM-dd HH:mm:ss"));
		hipoNotifyBean.setTrade_type("MINIPROGRA");
		return hipoNotifyBean;
	}
	/**
	 * @param aqb
	 * @param exchange_rate 汇率
	 * @return
	 * @throws InterruptedException 
	 */
	private HipoNotifyH5Bean initHipoH5NotifyBean(AcquireOrderBean aqb,String exchange_rate) throws InterruptedException {
		HipoNotifyH5Bean HipoNotifyH5Bean=new HipoNotifyH5Bean();
		MPayment ppm = new PayGateWayWapper().selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		HipoNotifyH5Bean.setAmount(aqb.getPayPrice());
		//结算？
		HipoNotifyH5Bean.setCurrency("CNY");
		HipoNotifyH5Bean.setExchange_rate(exchange_rate);
		HipoNotifyH5Bean.setTrade_time(YMTDateUtil.getBeforeOrNextSecond(-1, "yyyy-MM-dd HH:mm:ss"));
		HipoNotifyH5Bean.setAgent_order_id(trandno);
		HipoNotifyH5Bean.setPay_amount(aqb.getPayPrice());
		HipoNotifyH5Bean.setPay_currency("CNY");
		HipoNotifyH5Bean.setNo(TestDataManager.getRandomUUID().toString().replace("-", "").substring(0, 31));
		HipoNotifyH5Bean.setStatus("PAID");
		HipoNotifyH5Bean.setTrade_time(YMTDateUtil.getBeforeOrNextSecond(-10, "yyyy-MM-dd HH:mm:ss"));
		HipoNotifyH5Bean.setTrade_type("MINIPROGRA");
		HipoNotifyH5Bean.setOpenid(aqb.getOpenId());
		return HipoNotifyH5Bean;
	}
	/**
	 * 对源数据SignSHA1WithRSA加签
	 * 
	 * @param src
	 *            源数据
	 * @return
	 * @throws Exception
	 */
	private String SignSHA1WithRSA(String src) throws Exception {
		PrivateKey privateKey = RSAUtils.loadPrivateKey(EnvSetup.getData("privateK"));
		TreeMap tm = new TreeMap();
		tm.putAll((FormatUtil.httpStringToMap(src)));
		String fromatS = FormatUtil.mapToHttpString(tm, true);
		String signSWR = RSAUtils.SignSHA1WithRSA(fromatS, privateKey);
		return signSWR;
	}
}
